<%--
  Created by IntelliJ IDEA.
  User: liguanchen0629
  Date: 2021/7/1
  Time: 10:31
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" isErrorPage="true"%>
<html>
<head>
<meta charset="utf-8">
<title>注册页面</title>
<%
	pageContext.setAttribute("APP_PATH", request.getContextPath());
%>
<script src="${APP_PATH}/static/js/jquery-3.1.1.min.js"></script>
<link rel="stylesheet"
	href="${APP_PATH}/static/bootstrap-3.4.1-dist/css/bootstrap.min.css">
<script
	src="${APP_PATH}/static/bootstrap-3.4.1-dist/js/bootstrap.min.js"></script>
<%--    <link href="css/denglu.css" rel="stylesheet">--%>

</head>
<body style="background-color:#ebf4fb">
<div class="divbody" >
<form class="form-horizontal" action="${APP_PATH}/user/insert" onsubmit="return checkPassword()" enctype="multipart/form-data" method="post">
	<h1 align="center">用户注册</h1>
	<hr>
 <!--  <div class="form-group">
    <label for="inputEmail3" class="col-sm-5 control-label" >姓名</label>
    <div class="col-sm-6">
      <input type="text" class="form-control" name="id" placeholder="用户名" style="width:200px" required="required">
    </div>
  </div> -->
  
  <div class="form-group">
    <label for="password" class="col-sm-5 control-label">密码</label>
    <div class="col-sm-6">
      <input type="password" class="form-control" id="password" name="password" placeholder="Password" style="width:200px" required="required">
    </div>
  </div>
    <div class="form-group">
    <label for="password2" class="col-sm-5 control-label">确认密码</label>
    <div class="col-sm-6">
      <input type="password" class="form-control" id="password2" placeholder="再次确认密码" style="width:200px" required="required">
    </div>
  </div>
  
      <div class="form-group">
    <label for="name" class="col-sm-5 control-label">真实姓名</label>
    <div class="col-sm-6">
      <input type="text" id="name" class="form-control" name="name" placeholder="真实姓名" style="width:200px" required="required">
    </div>
  </div>
  
      <div class="form-group">
    <label for="idcard" class="col-sm-5 control-label">身份证号</label>
    <div class="col-sm-6">
      <input type="text" id="idcard" class="form-control" name="idcard" placeholder="身份证号" style="width:200px" required="required">
    </div>
  </div>
  
      <div class="form-group">
    <label for="phone" class="col-sm-5 control-label">手机号</label>
    <div class="col-sm-6">
      <input type="text" id="phone" class="form-control" name="phone" placeholder="手机号" style="width:200px" required="required">
    </div>
  </div>
  
   <div class="form-group">
    <label for=""license"" class="col-sm-5 control-label" >上传驾照</label>
    <input type="file" id="license" name="userlicense" required="required">
  </div>
  <div class="form-group">
    <div class="col-sm-offset-5 col-sm-5">
      <div class="checkbox">
        <label>
          <input type="checkbox"> 记住我
        </label>
      </div>
    </div>
  </div>
  <div class="form-group">
    <div class="col-sm-offset-5 col-sm-5">
      <button type="submit" class="btn btn-default">注册</button>
    </div>
  </div>
</form>

</div>
<script type="text/javascript">
function checkPassword(){
	let password=document.getElementById("password").value;
	let password2=document.getElementById("password2").value;
	if(password==password2){
	console.log("ok");
	alert("注册成功");
	return true;//返回true提交表单
	}else{
		console.log("fail");
	alert("两次密码输入不正确");
	return false;//返回false阻止提交表单
	}
	}
</script>
</body>
</html>
